package myStack;

public class Test {

    public static void main(String[] args) {
        MyStack myStack = new MyStack();

        System.out.println("进行压栈操作：");
        myStack.push(2);
        myStack.push(8);
        myStack.push(1998);
        myStack.push(0);
        System.out.println("获取栈的实际大小：");
        System.out.println(myStack.getSize());
        System.out.println("获取开辟数组长度：");
        System.out.println(myStack.array.length);

        System.out.println("进行出栈操作：");
        System.out.println(myStack.pop());
        System.out.println("获取栈的实际大小：");
        System.out.println(myStack.getSize());

        System.out.println("进行拿到栈顶元素操作：");
        System.out.println(myStack.peek());
        System.out.println("获取栈的实际大小：");
        System.out.println(myStack.getSize());
    }
}
